package com.itheima.es.config;

import org.springframework.amqp.core.*;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 苏成博
 * @date 2023-03-19 18:01
 */
@Configuration
public class MQConfig {
    //消息转换器
    @Bean
    public MessageConverter jsonMessageConverter(){
        return new Jackson2JsonMessageConverter();
    }
    //队列声明
    @Bean
    public Queue itemQueue(){
        return new Queue("item.queue");
    }

}
